package com.qingcheng.controller.order;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.pojo.order.CategoryReport;
import com.qingcheng.service.order.CategoryReportService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/categoryReport")
public class CategoryReportController {
    @Reference
    private CategoryReportService categoryReportService;

    /**
     * 昨天的数据统计
     * @return
     */
    @GetMapping("/yesterday")
    public List<CategoryReport> categoryReport(){
        LocalDate date=LocalDate.now().minusDays(1);//得到明天的日期
        return categoryReportService.categoryReport(date);
    }
    @GetMapping("category1Count")
    public List<Map>category1Count(String data1,String data2){
        return categoryReportService.category1Count(data1,data2);
    }

}
